package com.my.wechat.controller;

import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;

public class WxTemplateMesController {
	public WxMpTemplateMessage getTemplate(String toUser, String courtName, String keyword1, String keyword2,
			String linkUrl, String voteTempleteCode) {
		WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(toUser).templateId(voteTempleteCode)
				.build();
		templateMessage.getData().add(new WxMpTemplateData("first",
				courtName != null ? courtName + "小区业委会竞选开始了！" : "小区业委会竞选开始了！", "#F53413"));
		templateMessage.getData().add(new WxMpTemplateData("keyword1", keyword1, "#173177"));
		templateMessage.getData().add(new WxMpTemplateData("keyword2", keyword2, "#173177"));
		templateMessage.getData().add(new WxMpTemplateData("remark", "期待您的参与", "#173177"));

		templateMessage.setUrl(linkUrl);
		return templateMessage;
	}

	public WxMpTemplateMessage getTemplate2(String toUser, String courtName, String keyword1, String keyword2,
			String linkUrl, String voteTempleteCode) {
		WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(toUser).templateId(voteTempleteCode)
				.build();
		templateMessage.getData().add(new WxMpTemplateData("first",
				courtName != null ? courtName + "小区业委会竞选已经结束！" : "小区业委会竞选已经结束！", "#F53413"));
		templateMessage.getData().add(new WxMpTemplateData("keyword1", keyword1, "#173177"));
		templateMessage.getData().add(new WxMpTemplateData("keyword2", keyword2, "#173177"));
		templateMessage.getData().add(new WxMpTemplateData("remark", "恭喜您！", "#173177"));

		templateMessage.setUrl(linkUrl);
		return templateMessage;
	}
}
